package com.wpml.cloud.myprovider.config;

import com.wpml.cloud.myprovider.handler.PersonHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RequestPredicates;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;

@Configuration
public class MyRoute {

    @Bean
    public RouterFunction<ServerResponse> routerFunction(PersonHandler personHandler) {

        return RouterFunctions.route(
                RequestPredicates.GET("/p/getOne"), personHandler::getOne);
    }
}
